// routes/comboRoutes.js
const express = require('express');
const router = express.Router();
const comboController = require('../controllers/comboController');
const authenticateToken = require('../middleware/auth');

// 公共路由
router.get('/', comboController.getAllCombos);
router.get('/:id', comboController.getComboById);

// 管理员路由（需要认证）
router.post('/', authenticateToken, comboController.createCombo);
router.put('/:id', authenticateToken, comboController.updateCombo);
router.delete('/:id', authenticateToken, comboController.deleteCombo);

// 套餐项目路由
router.get('/:id/items', comboController.getComboItems);
router.post('/:id/items', authenticateToken, comboController.addComboItem);
router.put('/:id/items/:item_id', authenticateToken, comboController.updateComboItem);
router.delete('/:id/items/:item_id', authenticateToken, comboController.deleteComboItem);

module.exports = router;